package com.sdk.widget.threescreen.scrollview;

import android.content.res.Resources;
import android.graphics.Canvas;
import android.os.Build;

public class DisplayManager {

    public final static float DENSITY = Resources.getSystem().getDisplayMetrics().density;

    public static int dipToPixel(int dip){
        return (int) (dip * DENSITY + 0.5f);
    }

    public static boolean isHardwareAccelerated(Canvas canvas) {
        if(Build.VERSION.SDK_INT >= 11) {
            try {
                return (Boolean) Canvas.class.getDeclaredMethod("isHardwareAccelerated").invoke(canvas);
            } catch (Exception e) {
            }
        }
        return false;
    }

}
